package cc.yaomm.service.basic.controller.business.user.vo;

import cc.yaomm.common.basic.enums.PermissionTypeEnum;
import cc.yaomm.common.basic.enums.StatusEnum;
import cc.yaomm.common.basic.json.convert.EnumJsonSerializer;
import cc.yaomm.common.basic.lang.bo.BaseResultBO;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * Created by XQL on 2021/6/18.
 */
@Data
@ApiModel
public class PermissionResultVO extends BaseResultBO {

    /**
     * 权限ID
     */
    @ApiModelProperty("权限ID")
    private Long id;

    /**
     * 权限名
     */
    @ApiModelProperty("权限名")
    private String name;

    /**
     * 权限编码
     */
    @ApiModelProperty("权限编码")
    private String code;

    /**
     * 路由名
     */
    @ApiModelProperty("路由")
    private String router;

    /**
     * 类型 CATALOG-目录 MENU-菜单 BUTTON-按钮
     */
    @ApiModelProperty("类型")
    @JsonSerialize(using = EnumJsonSerializer.class)
    private PermissionTypeEnum type;

    /**
     * 状态 NORMAL-正常 LOCKED-锁定
     */
    @ApiModelProperty("状态")
    @JsonSerialize(using = EnumJsonSerializer.class)
    private StatusEnum status;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    private Date updateTime;

    /**
     * 子路由
     */
    @ApiModelProperty("子权限")
    private List<PermissionResultVO> children;

}
